home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # POW_GOGGLES.COG
- #
- # POWERUP Script - IR Goggles
- #
- # [YB & CYW]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- thing powerup local
- thing player local
- int bin=41 local
- sound pickupsnd=BactaPu1.wav local
- sound respawnsnd=Activate01.wav local
- flex amount local
-
- message touched
- message taken
- message respawn
-
- end
-
- # ========================================================================================
-
- code
- touched:
- player = GetSourceRef();
- amount = GetInv(player, bin);
-
- if((amount < GetInvMax(player, bin)) || (GetInv(player, 13) < GetInvMax(player, 13)))
- {
- TakeItem(GetSenderRef(), -1);
- call taken;
- }
-
- Return;
-
- # ........................................................................................
-
- taken:
- player = GetSourceRef();
- powerup = GetSenderRef();
-
- // Do effects.
- PlaySoundLocal(pickupsnd, 1, 0, 0);
- AddDynamicTint(player, 0.0, 0.0, 0.2);
-
- if(amount < GetInvMax(player, bin))
- {
- // Print("IR Goggles");
- jkPrintUNIString(player, bin);
-
- // Increment powerup amount.
- ChangeInv(player, bin, 1.0);
- SetInvAvailable(player, bin, 1);
- }
- else
- {
- // Print("Battery");
- jkPrintUNIString(player, 13);
- ChangeInv(player, 13, 25.0);
- SetInvAvailable(player, 13, 1);
- }
-
- Return;
-
- # ........................................................................................
-
- respawn:
- PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
-
- Return;
-
- end
-
-
-